package com.hj.demo.homework;

public class Test1 {
    public static void main(String[] args) {
        Dog dog = new Dog("欧欧", "雪纳瑞犬");
        Q q = new Q("楠楠", "Q妹");
        dog.show();
        System.out.println("==========");
        q.show();
    }
}
abstract class ZiBai{
    public static final int heath = 100;
    public static final int love = 0;
    public String name;
    public abstract void show();

    public ZiBai(String name) {
        this.name = name;
    }
}
class Dog extends ZiBai{
    public String pingZhong;

    public Dog(String name, String pingZhong) {
        super(name);
        this.pingZhong = pingZhong;
    }

    @Override
    public void show() {
        System.out.println("我的名字叫"+name+"，我的健康值："+heath+"，我和主人的亲密度："+love);
        System.out.println("我是一只"+pingZhong);
    }
}
class Q extends ZiBai{
    public String sex;

    public Q(String name, String sex) {
        super(name);
        this.sex = sex;
    }

    @Override
    public void show() {
        System.out.println("我的名字叫"+name+"，我的健康值："+heath+"，我和主人的亲密度："+love);
        System.out.println("我的性别是"+sex);
    }
}